Clarify regex warnings#130271
Conversation
|
@gewarren Here's the other PR you suggested I open. |
There was a problem hiding this comment.
Pull request overview
Updates in-source XML documentation for System.Text.RegularExpressions to better surface security guidance and to improve links to Learn content.
Changes:
- Update
RegexOptions.NonBacktrackingdocumentation to reference the relevant “NonBacktracking mode” section in the Learn article. - Replace
Regextype remarks with markdown-formatted remarks that include a prominent ReDoS/DoS warning and links to best practices.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexOptions.cs | Tweaks the doc comment for NonBacktracking to point readers at the relevant Learn section. |
| src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Regex.cs | Updates type-level remarks to markdown and adds a security warning plus forward links. |
Copilot Code ReviewHolistic AssessmentMotivation: Well-justified. Adding a prominent ReDoS security warning at the Approach: Correct. Uses the established Summary: ✅ LGTM. This is a well-scoped, documentation-only change that improves security guidance without risk. The format matches existing patterns in the same file area, and the content is accurate. Detailed FindingsDetailed Findings✅ Documentation Format — Matches existing codebase patternsThe CDATA markdown approach ( ✅ RegexOptions.cs — Correct section title referenceThe text now reads 💡 URL consistency — Minor observationThe new warning links to 💡 Line wrapping — Already flagged by existing reviewerThe long single-line paragraph and warning in the new Note This review was generated by GitHub Copilot.
|
Doc changes only. No code changes.
I'm updating regex docs across the various docs repos. This is one part of that update.
Changes:
Related PRs: